************************************************************************************************************************
************************************************************************************************************************
*********************************************** 4. REGRESSIONS *********************************************************
************************************************** FIRST DRAFT *********************************************************
************************************************************************************************************************

clear all 
set more off

global path_export0 "${path_results}/Regressions"
global path_export1 "${path_results}/Regressions/Tables"


capture mkdir "${path_export0}"
capture mkdir "${path_export1}"



************************************************************************************************************************

***** 1. SURVEY ROUND 1

************************************************************************************************************************
		
	**** 1.1 I open the round 1 Survey USA and append the other surveys

	clear all
	
	use "${path_results}/Data_Clean/USA_condensed_Round1"
	
	destring progress, replace
	
	append using "${path_results}/Data_Clean/Italy_condensed_Round1"

	append using "${path_results}/Data_Clean/Korea_condensed_Round1"
	
	**** 1.2 I fix some variables
	
		*** 1.2.1 Country ID
		
		encode country , gen(country_id)
		
		drop state_id
		
		encode state , gen(state_id)
					

	**** 1.3 I put the outcomes in standard deviations
	
		*** 1.3.1 I put the democracy variables in SD
	
		foreach x in dem_important_1 dem_satisfy_1 dem_order dem_decisive dem_econ dem_best dem_index {
			
			summ `x', d
			gen s_`x'=(`x'-r(mean))/r(sd) 
				
		}
		
		*** 1.3.2 I put the outcome variables in SD
	
		foreach x in ageism_index ageism_abs_therms_old ageism_rel_therms_old ageism_explicit {
			
			summ `x', d
			gen s_`x'=(`x'-r(mean))/r(sd) 
				
		}
		
		*** 1.3.3 I standardize other outcomes
	
		foreach x in contact_index ethnocentric_index {
			
			summ `x', d
			gen s_`x'=(`x'-r(mean))/r(sd) 
				
		}
		
		drop contact_index ethnocentric_index
		rename s_contact_index contact_index
		rename s_ethnocentric_index ethnocentric_index
	
	**** 1.4 I change and put some labels
		
	label variable s_dem_satisfy_1 "Satisfaction Democracy"
	label variable s_dem_important_1 "Dem. Important"
	label variable s_dem_index "Dem. Index"
	label variable s_dem_order "Dem. No Order"
	label variable s_dem_decisive "Dem. Indecisive"
	label variable s_dem_econ "Dem. Bad Economy"
	label variable s_dem_best "Democracy Better"
	
	label variable s_ageism_index "Ageism Index"
	label variable s_ageism_abs_therms_old "Ageism Thermometer: Absolute"
	label variable s_ageism_rel_therms_old "Ageism Thermometer"
	label variable s_ageism_explicit "Ageism Explicit"
	
	label variable dummy_old_not_care "Old Leaders Don´t Care"
	label variable dummy_age_gap_problem "Age Gap Problem"
	label variable dummy_opinion_discr_age "Political Discriminated b/c Age"
	label variable pol_disagreement_old "Political Disagreement Old"

	label variable strong_left "Left-wing"
	label variable strong_right "Right-wing"
	label variable ideology_1 "Ideology"
	
	label variable pca_old_leaders_bad "PCA Generational Grievances"
	label variable christian "Christian"
	label variable contact_index "Contact Old Index"
	label variable ethnocentric_index "Ethnocentric Index"

	
	
	**** 1.5 IAT: According to IATGEN, positive values of the D-Score implies association of the form Target A + Positive and Target B + Negative), whereas a negative D value indicates the opposite bias (Target A + Negative; Target B + Positive), and a zero score indicates no bias.
	
	** In our case, Target A=Old People, and Target B=Young people.  
	
	rename dscore_iat ageism_IAT
		
	label variable ageism_IAT "D-Score IAT"
	
	** I change the outcome so it will be more interpretable
	
	replace ageism_IAT=ageism_IAT*(-1)
	
	
************************************************************************************************************************

***** 2. GROUPED VARIABLES - OFFICIAL TABLES APPENDIX - TABLE D1 - PANELS A,B,C,D

************************************************************************************************************************

	**** 2.1 Set Outcomes
		
	local outcomes s_ageism_explicit s_ageism_rel_therms_old s_ageism_index ageism_IAT
	
	
	local indep_var1 old_leaders_bad_index age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  
	local indep_var2 personal_grievances_index age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id 
	local indep_var3 old_leaders_bad_index personal_grievances_index age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  

	
	local name OLS_1_Grouped_cov

	**** 2.2 Regressions in excel
	
	
	foreach x in `outcomes' {
			
		*** 2.2.1 Regressions all countries

			if "`x'"=="s_ageism_explicit" {
		
			reg `x' `indep_var1' , r
			outreg2 using "${path_export1}/`name'.xls", replace alpha(0.01, 0.05, 0.1) label

			}
			else {
				
			reg `x' `indep_var1' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			}
		
		reg `x' `indep_var2' , r
		outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

		reg `x' `indep_var3' , r
		outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label


		
		*** 2.2.2 Regressions per country

		foreach y in Italy Korea USA {
			
			if "`x'"=="s_ageism_explicit" {
		
			reg `x' `indep_var1' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", replace alpha(0.01, 0.05, 0.1) label

			}
			else {
				
			reg `x' `indep_var1' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			}
		
		reg `x' `indep_var2' if country=="`y'", r
		outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

		reg `x' `indep_var3' if country=="`y'", r
		outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label


		
		
		}		
		
	}		
	**** 2.3.Export to Latex
		
		*** 2.3.1 All countries
	
		est clear
		
		foreach x in `outcomes' {
				
			eststo: reg `x' `indep_var1' , r 
			estadd local  CC  "$\checkmark$"

			eststo: reg `x' `indep_var2' , r 
			estadd local  CC  "$\checkmark$"
			
			eststo: reg `x' `indep_var3' , r 
			estadd local  CC  "$\checkmark$"

	

			esttab using "${path_export1}/latex_`name'.tex", replace  ///
			b(3) se(3) ///
			 keep( strong_right strong_left anxiety_index contact_index age university female unemployed christian old_leaders_bad_index personal_grievances_index ethnocentric_index)  coeflabel( ) ///
			order (old_leaders_bad_index personal_grievances_index strong_right strong_left anxiety_index contact_index ethnocentric_index age university female unemployed christian) ///
			 star(* 0.10 ** 0.05 *** 0.01) ///
			 label ar2 booktabs nomtitle collabels(none) compress ///
			 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
			postfoot("\end{tabular}") ///
			 scalars("CC Regional Dummies") sfmt(0) ///
			mgroups("Ageism Explicit" "Ageism Thermometer" "Ageism Index" "Ageism IAT Score" , pattern(1 0 0 1 0 0 1 0 0 1 0 0 ) ///
	 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
			
			}	
		
		*** 2.3.2 Specific Countries
		
		foreach y in Italy Korea USA {
		
		est clear
		
			foreach x in `outcomes' {		

			eststo: reg `x' `indep_var1' if country=="`y'", r 
			estadd local  CC  "$\checkmark$"
			
			eststo: reg `x' `indep_var2' if country=="`y'", r 
			estadd local  CC  "$\checkmark$"
			
			eststo: reg `x' `indep_var3' if country=="`y'", r 
			estadd local  CC  "$\checkmark$"			
			

		
			esttab using "${path_export1}/latex_`name'_`y'.tex", replace  ///
			b(3) se(3) ///
				 keep( strong_right strong_left anxiety_index contact_index age university female unemployed christian old_leaders_bad_index personal_grievances_index ethnocentric_index)  coeflabel( ) ///
			order (old_leaders_bad_index personal_grievances_index strong_right strong_left anxiety_index contact_index ethnocentric_index age university female unemployed christian) ///
			 star(* 0.10 ** 0.05 *** 0.01) ///
			 label ar2 booktabs nomtitle collabels(none) compress ///
			 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
			postfoot("\end{tabular}") ///
			 scalars("CC Regional Dummies") sfmt(0) ///
			mgroups("Ageism Explicit" "Ageism Thermometer" "Ageism Index" "Ageism IAT Score" , pattern(1 0 0 1 0 0 1 0 0 1 0 0 ) ///
	 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
			
			}	
		}
				
	
************************************************************************************************************************

***** 3. GROUPED VARIABLES - OFFICIAL TABLES APPENDIX E - NO COVARIATES - TABLE E 2 - PANELS A,B,C,D

************************************************************************************************************************

	**** 3.1 Set Outcomes
		
	local outcomes s_ageism_explicit s_ageism_rel_therms_old s_ageism_index ageism_IAT
	
	
	local indep_var1 old_leaders_bad_index 
	local indep_var2 personal_grievances_index 
	local indep_var3 old_leaders_bad_index personal_grievances_index 
	
	local name OLS_2_Grouped_NO_cov

	**** 3.2 Regressions in excel
	
	
	foreach x in `outcomes' {
			
		*** 3.2.1 Regressions all countries

			if "`x'"=="s_ageism_explicit" {
		
			reg `x' `indep_var1' , r
			outreg2 using "${path_export1}/`name'.xls", replace alpha(0.01, 0.05, 0.1) label

			}
			else {
				
			reg `x' `indep_var1' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			}
		
		reg `x' `indep_var2' , r
		outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

		reg `x' `indep_var3' , r
		outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label


		
		*** 3.2.2 Regressions per country

		foreach y in Italy Korea USA {
			
			if "`x'"=="s_ageism_explicit" {
		
			reg `x' `indep_var1' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", replace alpha(0.01, 0.05, 0.1) label

			}
			else {
				
			reg `x' `indep_var1' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			}
		
		reg `x' `indep_var2' if country=="`y'", r
		outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

		reg `x' `indep_var3' if country=="`y'", r
		outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label


		
		
		}		
		
	}		
	**** 3.3.Export to Latex
		
		*** 3.3.1 All countries
	
		est clear
		
		foreach x in `outcomes' {
				
			eststo: reg `x' `indep_var1' , r 

			eststo: reg `x' `indep_var2' , r 
			
			eststo: reg `x' `indep_var3' , r 

	

			esttab using "${path_export1}/latex_`name'.tex", replace  ///
			b(3) se(3) ///
			 keep( old_leaders_bad_index personal_grievances_index)  coeflabel( ) ///
			order (old_leaders_bad_index personal_grievances_index ) ///
			 star(* 0.10 ** 0.05 *** 0.01) ///
			 label ar2 booktabs nomtitle collabels(none) compress ///
			 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
			postfoot("\end{tabular}") ///
			  sfmt(0) ///
			mgroups("Ageism Explicit" "Ageism Thermometer" "Ageism Index" "Ageism IAT Score" , pattern(1 0 0 1 0 0 1 0 0 1 0 0 ) ///
	 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
			
			}	
		
		*** 3.3.2 Specific Countries
		
		foreach y in Italy Korea USA {
		
		est clear
		
			foreach x in `outcomes' {		

			eststo: reg `x' `indep_var1' if country=="`y'", r 
			
			eststo: reg `x' `indep_var2' if country=="`y'", r 
			
			eststo: reg `x' `indep_var3' if country=="`y'", r 
			

		
			esttab using "${path_export1}/latex_`name'_`y'.tex", replace  ///
			b(3) se(3) ///
				 keep( old_leaders_bad_index personal_grievances_index)  coeflabel( ) ///
			order (old_leaders_bad_index personal_grievances_index ) ///
			 star(* 0.10 ** 0.05 *** 0.01) ///
			 label ar2 booktabs nomtitle collabels(none) compress ///
			 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
			postfoot("\end{tabular}") ///
			  sfmt(0) ///
			mgroups("Ageism Explicit" "Ageism Thermometer" "Ageism Index" "Ageism IAT Score" , pattern(1 0 0 1 0 0 1 0 0 1 0 0 ) ///
	 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
			
			}	
		}
						
************************************************************************************************************************

***** 4. GROUPED VARIABLES - OFFICIAL TABLES APPENDIX E2 - FULL RESULTS FOR YOUNG PEOPLE - TABLE E3 - PANELS A,B,C,D

************************************************************************************************************************

preserve

keep if young==1

	**** 4.1 Set Outcomes
		
	local outcomes s_ageism_explicit s_ageism_rel_therms_old s_ageism_index ageism_IAT
	
	
	local indep_var1 old_leaders_bad_index age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id i.country_id 
	local indep_var2 personal_grievances_index age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id i.country_id 
	local indep_var3 old_leaders_bad_index personal_grievances_index age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  i.country_id

	
	local name OLS_3_Grouped_cov_young

	**** 4.2 Regressions in excel
	
	
	foreach x in `outcomes' {
			
		*** 4.2.1 Regressions all countries

			if "`x'"=="s_ageism_explicit" {
		
			reg `x' `indep_var1' , r
			outreg2 using "${path_export1}/`name'.xls", replace alpha(0.01, 0.05, 0.1) label

			}
			else {
				
			reg `x' `indep_var1' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			}
		
		reg `x' `indep_var2' , r
		outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

		reg `x' `indep_var3' , r
		outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label


		
		*** 4.2.2 Regressions per country

		foreach y in Italy Korea USA {
			
			if "`x'"=="s_ageism_explicit" {
		
			reg `x' `indep_var1' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", replace alpha(0.01, 0.05, 0.1) label

			}
			else {
				
			reg `x' `indep_var1' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			}
		
		reg `x' `indep_var2' if country=="`y'", r
		outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

		reg `x' `indep_var3' if country=="`y'", r
		outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label


		
		
		}		
		
	}		
	**** 4.3.Export to Latex
		
		*** 4.3.1 All countries
	
		est clear
		
		foreach x in `outcomes' {
				
			eststo: reg `x' `indep_var1' , r 
			estadd local  CC  "$\checkmark$"

			eststo: reg `x' `indep_var2' , r 
			estadd local  CC  "$\checkmark$"
			
			eststo: reg `x' `indep_var3' , r 
			estadd local  CC  "$\checkmark$"

	

			esttab using "${path_export1}/latex_`name'.tex", replace  ///
			b(3) se(3) ///
			 keep( strong_right strong_left anxiety_index contact_index age university female unemployed christian old_leaders_bad_index personal_grievances_index ethnocentric_index)  coeflabel( ) ///
			order (old_leaders_bad_index personal_grievances_index strong_right strong_left anxiety_index contact_index ethnocentric_index age university female unemployed christian) ///
			 star(* 0.10 ** 0.05 *** 0.01) ///
			 label ar2 booktabs nomtitle collabels(none) compress ///
			 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
			postfoot("\end{tabular}") ///
			 scalars("CC Regional Dummies") sfmt(0) ///
			mgroups("Ageism Explicit" "Ageism Thermometer" "Ageism Index" "Ageism IAT Score" , pattern(1 0 0 1 0 0 1 0 0 1 0 0 ) ///
	 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
			
			}	
		
		*** 4.3.2 Specific Countries
		
		foreach y in Italy Korea USA {
		
		est clear
		
			foreach x in `outcomes' {		

			eststo: reg `x' `indep_var1' if country=="`y'", r 
			estadd local  CC  "$\checkmark$"
			
			eststo: reg `x' `indep_var2' if country=="`y'", r 
			estadd local  CC  "$\checkmark$"
			
			eststo: reg `x' `indep_var3' if country=="`y'", r 
			estadd local  CC  "$\checkmark$"			
			

		
			esttab using "${path_export1}/latex_`name'_`y'.tex", replace  ///
			b(3) se(3) ///
				 keep( strong_right strong_left anxiety_index contact_index age university female unemployed christian old_leaders_bad_index personal_grievances_index ethnocentric_index)  coeflabel( ) ///
			order (old_leaders_bad_index personal_grievances_index strong_right strong_left anxiety_index contact_index ethnocentric_index age university female unemployed christian) ///
			 star(* 0.10 ** 0.05 *** 0.01) ///
			 label ar2 booktabs nomtitle collabels(none) compress ///
			 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
			postfoot("\end{tabular}") ///
			 scalars("CC Regional Dummies") sfmt(0) ///
			mgroups("Ageism Explicit" "Ageism Thermometer" "Ageism Index" "Ageism IAT Score" , pattern(1 0 0 1 0 0 1 0 0 1 0 0 ) ///
	 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
			
			}	
		}
			
	restore
	
************************************************************************************************************************

***** 5. GROUPED VARIABLES - OFFICIAL TABLES APPENDIX 2 - NO COVARIATES - YOUNG RESPONDENTS - TABLE E4 - PANELS A,B,C,D

************************************************************************************************************************
preserve

keep if young==1

	**** 5.1 Set Outcomes
		
	local outcomes s_ageism_explicit s_ageism_rel_therms_old s_ageism_index ageism_IAT
	
	
	local indep_var1 old_leaders_bad_index 
	local indep_var2 personal_grievances_index 
	local indep_var3 old_leaders_bad_index personal_grievances_index 
	
	local name OLS_4_Grouped_NO_cov_young

	**** 5.2 Regressions in excel
	
	
	foreach x in `outcomes' {
			
		*** 5.2.1 Regressions all countries

			if "`x'"=="s_ageism_explicit" {
		
			reg `x' `indep_var1' , r
			outreg2 using "${path_export1}/`name'.xls", replace alpha(0.01, 0.05, 0.1) label

			}
			else {
				
			reg `x' `indep_var1' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			}
		
		reg `x' `indep_var2' , r
		outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

		reg `x' `indep_var3' , r
		outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label


		
		*** 5.2.2 Regressions per country

		foreach y in Italy Korea USA {
			
			if "`x'"=="s_ageism_explicit" {
		
			reg `x' `indep_var1' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", replace alpha(0.01, 0.05, 0.1) label

			}
			else {
				
			reg `x' `indep_var1' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			}
		
		reg `x' `indep_var2' if country=="`y'", r
		outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

		reg `x' `indep_var3' if country=="`y'", r
		outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label


		
		
		}		
		
	}		
	**** 5.3.Export to Latex
		
		*** 5.3.1 All countries
	
		est clear
		
		foreach x in `outcomes' {
				
			eststo: reg `x' `indep_var1' , r 

			eststo: reg `x' `indep_var2' , r 
			
			eststo: reg `x' `indep_var3' , r 

	

			esttab using "${path_export1}/latex_`name'.tex", replace  ///
			b(3) se(3) ///
			 keep( old_leaders_bad_index personal_grievances_index)  coeflabel( ) ///
			order (old_leaders_bad_index personal_grievances_index ) ///
			 star(* 0.10 ** 0.05 *** 0.01) ///
			 label ar2 booktabs nomtitle collabels(none) compress ///
			 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
			postfoot("\end{tabular}") ///
			  sfmt(0) ///
			mgroups("Ageism Explicit" "Ageism Thermometer" "Ageism Index" "Ageism IAT Score" , pattern(1 0 0 1 0 0 1 0 0 1 0 0 ) ///
	 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
			
			}	
		
		*** 5.3.2 Specific Countries
		
		foreach y in Italy Korea USA {
		
		est clear
		
			foreach x in `outcomes' {		

			eststo: reg `x' `indep_var1' if country=="`y'", r 
			
			eststo: reg `x' `indep_var2' if country=="`y'", r 
			
			eststo: reg `x' `indep_var3' if country=="`y'", r 
			

		
			esttab using "${path_export1}/latex_`name'_`y'.tex", replace  ///
			b(3) se(3) ///
				 keep( old_leaders_bad_index personal_grievances_index)  coeflabel( ) ///
			order (old_leaders_bad_index personal_grievances_index ) ///
			 star(* 0.10 ** 0.05 *** 0.01) ///
			 label ar2 booktabs nomtitle collabels(none) compress ///
			 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
			postfoot("\end{tabular}") ///
			  sfmt(0) ///
			mgroups("Ageism Explicit" "Ageism Thermometer" "Ageism Index" "Ageism IAT Score" , pattern(1 0 0 1 0 0 1 0 0 1 0 0 ) ///
	 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
			
			}	
		}
		
restore		
		
************************************************************************************************************************

***** 6. ALL VARIABLES IN INDIVIDUAL ALL COVARIATES - TABLE E5 - PANELS A,B,C,D

************************************************************************************************************************

	**** 6.1 PART 1

		**** 6.1.1 Set Outcomes

		local outcomes s_ageism_explicit s_ageism_rel_therms_old 
		
		local indep_var1 politician_too_old age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id i.country_id  
		local indep_var2 dummy_old_not_care age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  i.country_id 
		local indep_var3 dummy_age_gap_problem age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  i.country_id 
		local indep_var4 dummy_opinion_discr_age age university female unemployed christian strong_right strong_left anxiety_index ethnocentric_index contact_index i.state_id i.country_id  
		local indep_var5 pol_disagreement_old age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  i.country_id 
		local indep_var6 politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  i.country_id 

		
		local name OLS_5_1_Individual_cov

		**** 6.1.2 Regressions in excel
		
		
		foreach x in `outcomes' {
				
			*** 6.1.2.1 Regressions all countries

				if "`x'"=="s_ageism_explicit" {
			
				reg `x' `indep_var1' , r
				outreg2 using "${path_export1}/`name'.xls", replace alpha(0.01, 0.05, 0.1) label
				
				}
				else {
					
				reg `x' `indep_var1' , r
				outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

				}
			
			reg `x' `indep_var2' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var3' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var4' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var5' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label
			
			reg `x' `indep_var6' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			*** 6.1.2.2 Regressions per country

			foreach y in Italy Korea USA {
				
				if "`x'"=="s_ageism_explicit" {
			
				reg `x' `indep_var1' if country=="`y'", r
				outreg2 using "${path_export1}/`name'_`y'.xls", replace alpha(0.01, 0.05, 0.1) label

				}
				else {
					
				reg `x' `indep_var1' if country=="`y'", r
				outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

				}
			
			reg `x' `indep_var2' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var3' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var4' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var5' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var6' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label
			
			}		
			
		}		
		**** 6.1.2.Export to Latex
			
			*** 6.1.2.1 All countries
		
			est clear
			
			foreach x in `outcomes' {
					
				eststo: reg `x' `indep_var1' , r 
				estadd local  CC  "$\checkmark$"

				eststo: reg `x' `indep_var2' , r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var3' , r 
				estadd local  CC  "$\checkmark$"

				
				eststo: reg `x' `indep_var4' , r 
				estadd local  CC  "$\checkmark$"

				
				eststo: reg `x' `indep_var5' , r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var6' , r 
				estadd local  CC  "$\checkmark$"


				esttab using "${path_export1}/latex_`name'.tex", replace  ///
				b(3) se(3) ///
				 keep( politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old strong_right strong_left anxiety_index contact_index age university female unemployed christian ethnocentric_index)  coeflabel( ) ///
				order (politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old strong_right strong_left anxiety_index contact_index ethnocentric_index age university female unemployed christian) ///
				 star(* 0.10 ** 0.05 *** 0.01) ///
				 label ar2 booktabs nomtitle collabels(none) compress ///
				 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
				postfoot("\end{tabular}") ///
				 scalars("CC Regional Dummies") sfmt(0) ///
				mgroups("Ageism Explicit" "Ageism Thermometer" , pattern(1 0 0 0 0 0 1 0 0 0 0 0) ///
		 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
				
				}	
			
			*** 6.1.2.2 Specific Countries
			
			foreach y in Italy Korea USA {
			
			est clear
			
				foreach x in `outcomes' {		

				eststo: reg `x' `indep_var1' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var2' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var3' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"			
				
				eststo: reg `x' `indep_var4' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var5' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var6' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"

				esttab using "${path_export1}/latex_`name'_`y'.tex", replace  ///
				b(3) se(3) ///
				 keep( politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old strong_right strong_left anxiety_index contact_index age university female unemployed christian ethnocentric_index)  coeflabel( ) ///
				order (politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old strong_right strong_left anxiety_index contact_index ethnocentric_index age university female unemployed christian) ///
				 star(* 0.10 ** 0.05 *** 0.01) ///
				 label ar2 booktabs nomtitle collabels(none) compress ///
				 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
				postfoot("\end{tabular}") ///
				 scalars("CC Regional Dummies") sfmt(0) ///
				mgroups("Ageism Explicit" "Ageism Thermometer" , pattern(1 0 0 0 0 0 1 0 0 0 0 0) ///
		 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
				
				}	
			}
			
	**** 6.2 PART 2

		**** 6.2.1 Set Outcomes

		local outcomes s_ageism_index ageism_IAT 
		
		
		local indep_var1 politician_too_old age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id i.country_id  
		local indep_var2 dummy_old_not_care age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  i.country_id 
		local indep_var3 dummy_age_gap_problem age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  i.country_id 
		local indep_var4 dummy_opinion_discr_age age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id i.country_id  
		local indep_var5 pol_disagreement_old age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  i.country_id 
		local indep_var6 politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  i.country_id 

		
		local name OLS_5_2_Individual_cov

		**** 6.2.2 Regressions in excel
		
		
		foreach x in `outcomes' {
				
			*** 6.2.2.1 Regressions all countries

				if "`x'"=="s_ageism_index" {
			
				reg `x' `indep_var1' , r
				outreg2 using "${path_export1}/`name'.xls", replace alpha(0.01, 0.05, 0.1) label
				
				}
				else {
					
				reg `x' `indep_var1' , r
				outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

				}
			
			reg `x' `indep_var2' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var3' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var4' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var5' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label
			
			reg `x' `indep_var6' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			*** 6.2.2.2 Regressions per country

			foreach y in Italy Korea USA {
				
				if "`x'"=="s_ageism_index" {
			
				reg `x' `indep_var1' if country=="`y'", r
				outreg2 using "${path_export1}/`name'_`y'.xls", replace alpha(0.01, 0.05, 0.1) label

				}
				else {
					
				reg `x' `indep_var1' if country=="`y'", r
				outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

				}
			
			reg `x' `indep_var2' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var3' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var4' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var5' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var6' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label
			
			}		
			
		}		
		**** 6.2.2.Export to Latex
			
			*** 6.2.2.1 All countries
		
			est clear
			
			foreach x in `outcomes' {
					
				eststo: reg `x' `indep_var1' , r 
				estadd local  CC  "$\checkmark$"

				eststo: reg `x' `indep_var2' , r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var3' , r 
				estadd local  CC  "$\checkmark$"

				
				eststo: reg `x' `indep_var4' , r 
				estadd local  CC  "$\checkmark$"

				
				eststo: reg `x' `indep_var5' , r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var6' , r 
				estadd local  CC  "$\checkmark$"


				esttab using "${path_export1}/latex_`name'.tex", replace  ///
				b(3) se(3) ///
				 keep( politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old strong_right strong_left anxiety_index contact_index age university female unemployed christian ethnocentric_index)  coeflabel( ) ///
				order (politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old strong_right strong_left anxiety_index contact_index ethnocentric_index age university female unemployed christian) ///
				 star(* 0.10 ** 0.05 *** 0.01) ///
				 label ar2 booktabs nomtitle collabels(none) compress ///
				 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
				postfoot("\end{tabular}") ///
				 scalars("CC Regional Dummies") sfmt(0) ///
				mgroups("Ageism Index" "Ageism IAT Score" , pattern(1 0 0 0 0 0 1 0 0 0 0 0) ///
		 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
				
				}	
			
			*** 6.2.2.2 Specific Countries
			
			foreach y in Italy Korea USA {
			
			est clear
			
				foreach x in `outcomes' {		

				eststo: reg `x' `indep_var1' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var2' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var3' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"			
				
				eststo: reg `x' `indep_var4' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var5' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var6' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"

				esttab using "${path_export1}/latex_`name'_`y'.tex", replace  ///
				b(3) se(3) ///
				 keep( politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old strong_right strong_left anxiety_index contact_index age university female unemployed christian ethnocentric_index)  coeflabel( ) ///
				order (politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old strong_right strong_left anxiety_index contact_index ethnocentric_index age university female unemployed christian) ///
				 star(* 0.10 ** 0.05 *** 0.01) ///
				 label ar2 booktabs nomtitle collabels(none) compress ///
				 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
				postfoot("\end{tabular}") ///
				 scalars("CC Regional Dummies") sfmt(0) ///
				mgroups("Ageism Index" "Ageism IAT Score" , pattern(1 0 0 0 0 0 1 0 0 0 0 0) ///
		 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
				
				}	
			}	

		
************************************************************************************************************************

***** 7. ALL VARIABLES IN INDIVIDUAL NO COVARIATES - TABLE E6 - PANELS A,B,C,D

************************************************************************************************************************

	**** 7.1 PART 1

		**** 7.1.1 Set Outcomes

		local outcomes s_ageism_explicit s_ageism_rel_therms_old 
		
		local indep_var1 politician_too_old 
		local indep_var2 dummy_old_not_care 
		local indep_var3 dummy_age_gap_problem 
		local indep_var4 dummy_opinion_discr_age 
		local indep_var5 pol_disagreement_old 
		local indep_var6 politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old 

		
		local name OLS_6_1_Individual_Nocov

		**** 7.1.2 Regressions in excel
		
		
		foreach x in `outcomes' {
				
			*** 7.1.2.1 Regressions all countries

				if "`x'"=="s_ageism_explicit" {
			
				reg `x' `indep_var1' , r
				outreg2 using "${path_export1}/`name'.xls", replace alpha(0.01, 0.05, 0.1) label
				
				}
				else {
					
				reg `x' `indep_var1' , r
				outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

				}
			
			reg `x' `indep_var2' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var3' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var4' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var5' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label
			
			reg `x' `indep_var6' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			*** 7.1.2.2 Regressions per country

			foreach y in Italy Korea USA {
				
				if "`x'"=="s_ageism_explicit" {
			
				reg `x' `indep_var1' if country=="`y'", r
				outreg2 using "${path_export1}/`name'_`y'.xls", replace alpha(0.01, 0.05, 0.1) label

				}
				else {
					
				reg `x' `indep_var1' if country=="`y'", r
				outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

				}
			
			reg `x' `indep_var2' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var3' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var4' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var5' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var6' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label
			
			}		
			
		}		
		**** 7.1.2.Export to Latex
			
			*** 7.1.2.1 All countries
		
			est clear
			
			foreach x in `outcomes' {
					
				eststo: reg `x' `indep_var1' , r 

				eststo: reg `x' `indep_var2' , r 
				
				eststo: reg `x' `indep_var3' , r 

				
				eststo: reg `x' `indep_var4' , r 

				
				eststo: reg `x' `indep_var5' , r 
				
				eststo: reg `x' `indep_var6' , r 


				esttab using "${path_export1}/latex_`name'.tex", replace  ///
				b(3) se(3) ///
				 keep( politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old )  coeflabel( ) ///
				order (politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old ) ///
				 star(* 0.10 ** 0.05 *** 0.01) ///
				 label ar2 booktabs nomtitle collabels(none) compress ///
				 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
				postfoot("\end{tabular}") ///
				  sfmt(0) ///
				mgroups("Ageism Explicit" "Ageism Thermometer" , pattern(1 0 0 0 0 0 1 0 0 0 0 0) ///
		 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
				
				}	
			
			*** 7.1.2.2 Specific Countries
			
			foreach y in Italy Korea USA {
			
			est clear
			
				foreach x in `outcomes' {		

				eststo: reg `x' `indep_var1' if country=="`y'", r 
				
				eststo: reg `x' `indep_var2' if country=="`y'", r 
				
				eststo: reg `x' `indep_var3' if country=="`y'", r 
				
				eststo: reg `x' `indep_var4' if country=="`y'", r 
				
				eststo: reg `x' `indep_var5' if country=="`y'", r 
				
				eststo: reg `x' `indep_var6' if country=="`y'", r 

				esttab using "${path_export1}/latex_`name'_`y'.tex", replace  ///
				b(3) se(3) ///
				 keep( politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old )  coeflabel( ) ///
				order (politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old ) ///
				 star(* 0.10 ** 0.05 *** 0.01) ///
				 label ar2 booktabs nomtitle collabels(none) compress ///
				 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
				postfoot("\end{tabular}") ///
				 sfmt(0) ///
				mgroups("Ageism Explicit" "Ageism Thermometer" , pattern(1 0 0 0 0 0 1 0 0 0 0 0) ///
		 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
				
				}	
			}
			
	**** 7.2 PART 2

		**** 7.2.1 Set Outcomes

		local outcomes s_ageism_index ageism_IAT 
		
		
		local indep_var1 politician_too_old 
		local indep_var2 dummy_old_not_care 
		local indep_var3 dummy_age_gap_problem 
		local indep_var4 dummy_opinion_discr_age 
		local indep_var5 pol_disagreement_old 
		local indep_var6 politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old 

		
		local name OLS_6_2_Individual_Nocov

		**** 7.2.2 Regressions in excel
		
		
		foreach x in `outcomes' {
				
			*** 7.2.2.1 Regressions all countries

				if "`x'"=="s_ageism_index" {
			
				reg `x' `indep_var1' , r
				outreg2 using "${path_export1}/`name'.xls", replace alpha(0.01, 0.05, 0.1) label
				
				}
				else {
					
				reg `x' `indep_var1' , r
				outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

				}
			
			reg `x' `indep_var2' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var3' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var4' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var5' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label
			
			reg `x' `indep_var6' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			*** 7.2.2.2 Regressions per country

			foreach y in Italy Korea USA {
				
				if "`x'"=="s_ageism_index" {
			
				reg `x' `indep_var1' if country=="`y'", r
				outreg2 using "${path_export1}/`name'_`y'.xls", replace alpha(0.01, 0.05, 0.1) label

				}
				else {
					
				reg `x' `indep_var1' if country=="`y'", r
				outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

				}
			
			reg `x' `indep_var2' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var3' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var4' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var5' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var6' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label
			
			}		
			
		}		
		**** 7.2.2.Export to Latex
			
			*** 7.2.2.1 All countries
		
			est clear
			
			foreach x in `outcomes' {
					
				eststo: reg `x' `indep_var1' , r 

				eststo: reg `x' `indep_var2' , r 
				
				eststo: reg `x' `indep_var3' , r 

				
				eststo: reg `x' `indep_var4' , r 

				
				eststo: reg `x' `indep_var5' , r 
				
				eststo: reg `x' `indep_var6' , r 


				esttab using "${path_export1}/latex_`name'.tex", replace  ///
				b(3) se(3) ///
				 keep( politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old )  coeflabel( ) ///
				order (politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old ) ///
				 star(* 0.10 ** 0.05 *** 0.01) ///
				 label ar2 booktabs nomtitle collabels(none) compress ///
				 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
				postfoot("\end{tabular}") ///
				  sfmt(0) ///
				mgroups("Ageism Index" "Ageism IAT Score" , pattern(1 0 0 0 0 0 1 0 0 0 0 0) ///
		 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
				
				}	
			
			*** 7.2.2.2 Specific Countries
			
			foreach y in Italy Korea USA {
			
			est clear
			
				foreach x in `outcomes' {		

				eststo: reg `x' `indep_var1' if country=="`y'", r 
				
				eststo: reg `x' `indep_var2' if country=="`y'", r 
				
				eststo: reg `x' `indep_var3' if country=="`y'", r 
				
				eststo: reg `x' `indep_var4' if country=="`y'", r 
				
				eststo: reg `x' `indep_var5' if country=="`y'", r 
				
				eststo: reg `x' `indep_var6' if country=="`y'", r 

				esttab using "${path_export1}/latex_`name'_`y'.tex", replace  ///
				b(3) se(3) ///
				 keep( politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old )  coeflabel( ) ///
				order (politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old ) ///
				 star(* 0.10 ** 0.05 *** 0.01) ///
				 label ar2 booktabs nomtitle collabels(none) compress ///
				 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
				postfoot("\end{tabular}") ///
				 sfmt(0) ///
				mgroups("Ageism Index" "Ageism IAT Score" , pattern(1 0 0 0 0 0 1 0 0 0 0 0) ///
		 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
				
				}	
			}	


			
************************************************************************************************************************

***** 8. ALL VARIABLES IN INDIVIDUAL ALL COVARIATES - YOUNG RESPONDENTS - TABLE E7 - PANELS A,B,C,D

************************************************************************************************************************

preserve

keep if young==1


	**** 8.1 PART 1

		**** 8.1.1 Set Outcomes

		local outcomes s_ageism_explicit s_ageism_rel_therms_old 
		
		local indep_var1 politician_too_old age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id i.country_id  
		local indep_var2 dummy_old_not_care age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  i.country_id 
		local indep_var3 dummy_age_gap_problem age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  i.country_id 
		local indep_var4 dummy_opinion_discr_age age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id i.country_id  
		local indep_var5 pol_disagreement_old age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  i.country_id 
		local indep_var6 politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  i.country_id 

		
		local name OLS_7_1_Individual_cov_young

		**** 8.1.2 Regressions in excel
		
		
		foreach x in `outcomes' {
				
			*** 8.1.2.1 Regressions all countries

				if "`x'"=="s_ageism_explicit" {
			
				reg `x' `indep_var1' , r
				outreg2 using "${path_export1}/`name'.xls", replace alpha(0.01, 0.05, 0.1) label
				
				}
				else {
					
				reg `x' `indep_var1' , r
				outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

				}
			
			reg `x' `indep_var2' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var3' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var4' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var5' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label
			
			reg `x' `indep_var6' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			*** 8.1.2.2 Regressions per country

			foreach y in Italy Korea USA {
				
				if "`x'"=="s_ageism_explicit" {
			
				reg `x' `indep_var1' if country=="`y'", r
				outreg2 using "${path_export1}/`name'_`y'.xls", replace alpha(0.01, 0.05, 0.1) label

				}
				else {
					
				reg `x' `indep_var1' if country=="`y'", r
				outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

				}
			
			reg `x' `indep_var2' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var3' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var4' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var5' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var6' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label
			
			}		
			
		}		
		**** 8.1.2.Export to Latex
			
			*** 8.1.2.1 All countries
		
			est clear
			
			foreach x in `outcomes' {
					
				eststo: reg `x' `indep_var1' , r 
				estadd local  CC  "$\checkmark$"

				eststo: reg `x' `indep_var2' , r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var3' , r 
				estadd local  CC  "$\checkmark$"

				
				eststo: reg `x' `indep_var4' , r 
				estadd local  CC  "$\checkmark$"

				
				eststo: reg `x' `indep_var5' , r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var6' , r 
				estadd local  CC  "$\checkmark$"


				esttab using "${path_export1}/latex_`name'.tex", replace  ///
				b(3) se(3) ///
				 keep( politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old strong_right strong_left anxiety_index contact_index age university female unemployed christian ethnocentric_index)  coeflabel( ) ///
				order (politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old strong_right strong_left anxiety_index contact_index ethnocentric_index age university female unemployed christian) ///
				 star(* 0.10 ** 0.05 *** 0.01) ///
				 label ar2 booktabs nomtitle collabels(none) compress ///
				 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
				postfoot("\end{tabular}") ///
				 scalars("CC Regional Dummies") sfmt(0) ///
				mgroups("Ageism Explicit" "Ageism Thermometer" , pattern(1 0 0 0 0 0 1 0 0 0 0 0) ///
		 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
				
				}	
			
			*** 8.1.2.2 Specific Countries
			
			foreach y in Italy Korea USA {
			
			est clear
			
				foreach x in `outcomes' {		

				eststo: reg `x' `indep_var1' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var2' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var3' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"			
				
				eststo: reg `x' `indep_var4' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var5' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var6' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"

				esttab using "${path_export1}/latex_`name'_`y'.tex", replace  ///
				b(3) se(3) ///
				 keep( politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old strong_right strong_left anxiety_index contact_index ethnocentric_index age university female unemployed christian)  coeflabel( ) ///
				order (politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old strong_right strong_left anxiety_index contact_index ethnocentric_index age university female unemployed christian) ///
				 star(* 0.10 ** 0.05 *** 0.01) ///
				 label ar2 booktabs nomtitle collabels(none) compress ///
				 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
				postfoot("\end{tabular}") ///
				 scalars("CC Regional Dummies") sfmt(0) ///
				mgroups("Ageism Explicit" "Ageism Thermometer" , pattern(1 0 0 0 0 0 1 0 0 0 0 0) ///
		 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
				
				}	
			}
			
	**** 8.2 PART 2

		**** 8.2.1 Set Outcomes

		local outcomes s_ageism_index ageism_IAT 
		
		
		local indep_var1 politician_too_old age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id i.country_id  
		local indep_var2 dummy_old_not_care age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  i.country_id 
		local indep_var3 dummy_age_gap_problem age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  i.country_id 
		local indep_var4 dummy_opinion_discr_age age university female unemployed christian strong_right strong_left anxiety_index ethnocentric_index contact_index i.state_id i.country_id  
		local indep_var5 pol_disagreement_old age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  i.country_id 
		local indep_var6 politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old age university female unemployed christian strong_right strong_left anxiety_index contact_index ethnocentric_index i.state_id  i.country_id 

		
		local name OLS_7_2_Individual_cov_young

		**** 8.2.2 Regressions in excel
		
		
		foreach x in `outcomes' {
				
			*** 8.2.2.1 Regressions all countries

				if "`x'"=="s_ageism_index" {
			
				reg `x' `indep_var1' , r
				outreg2 using "${path_export1}/`name'.xls", replace alpha(0.01, 0.05, 0.1) label
				
				}
				else {
					
				reg `x' `indep_var1' , r
				outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

				}
			
			reg `x' `indep_var2' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var3' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var4' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var5' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label
			
			reg `x' `indep_var6' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			*** 8.2.2.2 Regressions per country

			foreach y in Italy Korea USA {
				
				if "`x'"=="s_ageism_index" {
			
				reg `x' `indep_var1' if country=="`y'", r
				outreg2 using "${path_export1}/`name'_`y'.xls", replace alpha(0.01, 0.05, 0.1) label

				}
				else {
					
				reg `x' `indep_var1' if country=="`y'", r
				outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

				}
			
			reg `x' `indep_var2' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var3' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var4' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var5' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var6' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label
			
			}		
			
		}		
		**** 8.2.2.Export to Latex
			
			*** 8.2.2.1 All countries
		
			est clear
			
			foreach x in `outcomes' {
					
				eststo: reg `x' `indep_var1' , r 
				estadd local  CC  "$\checkmark$"

				eststo: reg `x' `indep_var2' , r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var3' , r 
				estadd local  CC  "$\checkmark$"

				
				eststo: reg `x' `indep_var4' , r 
				estadd local  CC  "$\checkmark$"

				
				eststo: reg `x' `indep_var5' , r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var6' , r 
				estadd local  CC  "$\checkmark$"


				esttab using "${path_export1}/latex_`name'.tex", replace  ///
				b(3) se(3) ///
				 keep( politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old strong_right strong_left anxiety_index contact_index age university female unemployed christian ethnocentric_index)  coeflabel( ) ///
				order (politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old strong_right strong_left anxiety_index contact_index ethnocentric_index age university female unemployed christian) ///
				 star(* 0.10 ** 0.05 *** 0.01) ///
				 label ar2 booktabs nomtitle collabels(none) compress ///
				 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
				postfoot("\end{tabular}") ///
				 scalars("CC Regional Dummies") sfmt(0) ///
				mgroups("Ageism Index" "Ageism IAT Score" , pattern(1 0 0 0 0 0 1 0 0 0 0 0) ///
		 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
				
				}	
			
			*** 8.2.2.2 Specific Countries
			
			foreach y in Italy Korea USA {
			
			est clear
			
				foreach x in `outcomes' {		

				eststo: reg `x' `indep_var1' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var2' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var3' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"			
				
				eststo: reg `x' `indep_var4' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var5' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"
				
				eststo: reg `x' `indep_var6' if country=="`y'", r 
				estadd local  CC  "$\checkmark$"

				esttab using "${path_export1}/latex_`name'_`y'.tex", replace  ///
				b(3) se(3) ///
				 keep( politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old strong_right strong_left anxiety_index contact_index ethnocentric_index age university female unemployed christian)  coeflabel( ) ///
				order (politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old strong_right strong_left anxiety_index contact_index ethnocentric_index age university female unemployed christian) ///
				 star(* 0.10 ** 0.05 *** 0.01) ///
				 label ar2 booktabs nomtitle collabels(none) compress ///
				 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
				postfoot("\end{tabular}") ///
				 scalars("CC Regional Dummies") sfmt(0) ///
				mgroups("Ageism Index" "Ageism IAT Score" , pattern(1 0 0 0 0 0 1 0 0 0 0 0) ///
		 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
				
				}	
			}	
			
	restore		
			
************************************************************************************************************************

***** 9. ALL VARIABLES IN INDIVIDUAL NO COVARIATES - YOUNG RESPONDENTS -- TABLE E8 - PANELS A,B,C,D

************************************************************************************************************************

preserve

keep if young==1

	**** 9.1 PART 1

		**** 9.1.1 Set Outcomes

		local outcomes s_ageism_explicit s_ageism_rel_therms_old 
		
		local indep_var1 politician_too_old 
		local indep_var2 dummy_old_not_care 
		local indep_var3 dummy_age_gap_problem 
		local indep_var4 dummy_opinion_discr_age 
		local indep_var5 pol_disagreement_old 
		local indep_var6 politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old 

		
		local name OLS_8_1_Individual_Nocov_young

		**** 9.1.2 Regressions in excel
		
		
		foreach x in `outcomes' {
				
			*** 9.1.2.1 Regressions all countries

				if "`x'"=="s_ageism_explicit" {
			
				reg `x' `indep_var1' , r
				outreg2 using "${path_export1}/`name'.xls", replace alpha(0.01, 0.05, 0.1) label
				
				}
				else {
					
				reg `x' `indep_var1' , r
				outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

				}
			
			reg `x' `indep_var2' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var3' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var4' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var5' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label
			
			reg `x' `indep_var6' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			*** 9.1.2.2 Regressions per country

			foreach y in Italy Korea USA {
				
				if "`x'"=="s_ageism_explicit" {
			
				reg `x' `indep_var1' if country=="`y'", r
				outreg2 using "${path_export1}/`name'_`y'.xls", replace alpha(0.01, 0.05, 0.1) label

				}
				else {
					
				reg `x' `indep_var1' if country=="`y'", r
				outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

				}
			
			reg `x' `indep_var2' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var3' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var4' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var5' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var6' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label
			
			}		
			
		}		
		**** 9.1.2.Export to Latex
			
			*** 9.1.2.1 All countries
		
			est clear
			
			foreach x in `outcomes' {
					
				eststo: reg `x' `indep_var1' , r 

				eststo: reg `x' `indep_var2' , r 
				
				eststo: reg `x' `indep_var3' , r 

				
				eststo: reg `x' `indep_var4' , r 

				
				eststo: reg `x' `indep_var5' , r 
				
				eststo: reg `x' `indep_var6' , r 


				esttab using "${path_export1}/latex_`name'.tex", replace  ///
				b(3) se(3) ///
				 keep( politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old )  coeflabel( ) ///
				order (politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old ) ///
				 star(* 0.10 ** 0.05 *** 0.01) ///
				 label ar2 booktabs nomtitle collabels(none) compress ///
				 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
				postfoot("\end{tabular}") ///
				  sfmt(0) ///
				mgroups("Ageism Explicit" "Ageism Thermometer" , pattern(1 0 0 0 0 0 1 0 0 0 0 0) ///
		 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
				
				}	
			
			*** 9.1.2.2 Specific Countries
			
			foreach y in Italy Korea USA {
			
			est clear
			
				foreach x in `outcomes' {		

				eststo: reg `x' `indep_var1' if country=="`y'", r 
				
				eststo: reg `x' `indep_var2' if country=="`y'", r 
				
				eststo: reg `x' `indep_var3' if country=="`y'", r 
				
				eststo: reg `x' `indep_var4' if country=="`y'", r 
				
				eststo: reg `x' `indep_var5' if country=="`y'", r 
				
				eststo: reg `x' `indep_var6' if country=="`y'", r 

				esttab using "${path_export1}/latex_`name'_`y'.tex", replace  ///
				b(3) se(3) ///
				 keep( politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old )  coeflabel( ) ///
				order (politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old ) ///
				 star(* 0.10 ** 0.05 *** 0.01) ///
				 label ar2 booktabs nomtitle collabels(none) compress ///
				 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
				postfoot("\end{tabular}") ///
				 sfmt(0) ///
				mgroups("Ageism Explicit" "Ageism Thermometer" , pattern(1 0 0 0 0 0 1 0 0 0 0 0) ///
		 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
				
				}	
			}
			
	**** 9.2 PART 2

		**** 9.2.1 Set Outcomes

		local outcomes s_ageism_index ageism_IAT 
		
		
		local indep_var1 politician_too_old 
		local indep_var2 dummy_old_not_care 
		local indep_var3 dummy_age_gap_problem 
		local indep_var4 dummy_opinion_discr_age 
		local indep_var5 pol_disagreement_old 
		local indep_var6 politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old 

		
		local name OLS_8_2_Individual_Nocov_young

		**** 9.2.2 Regressions in excel
		
		
		foreach x in `outcomes' {
				
			*** 9.2.2.1 Regressions all countries

				if "`x'"=="s_ageism_index" {
			
				reg `x' `indep_var1' , r
				outreg2 using "${path_export1}/`name'.xls", replace alpha(0.01, 0.05, 0.1) label
				
				}
				else {
					
				reg `x' `indep_var1' , r
				outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

				}
			
			reg `x' `indep_var2' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var3' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var4' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var5' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label
			
			reg `x' `indep_var6' , r
			outreg2 using "${path_export1}/`name'.xls", append alpha(0.01, 0.05, 0.1) label

			*** 9.2.2.2 Regressions per country

			foreach y in Italy Korea USA {
				
				if "`x'"=="s_ageism_index" {
			
				reg `x' `indep_var1' if country=="`y'", r
				outreg2 using "${path_export1}/`name'_`y'.xls", replace alpha(0.01, 0.05, 0.1) label

				}
				else {
					
				reg `x' `indep_var1' if country=="`y'", r
				outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

				}
			
			reg `x' `indep_var2' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var3' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var4' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var5' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label

			reg `x' `indep_var6' if country=="`y'", r
			outreg2 using "${path_export1}/`name'_`y'.xls", append alpha(0.01, 0.05, 0.1) label
			
			}		
			
		}		
		**** 9.2.2.Export to Latex
			
			*** 9.2.2.1 All countries
		
			est clear
			
			foreach x in `outcomes' {
					
				eststo: reg `x' `indep_var1' , r 

				eststo: reg `x' `indep_var2' , r 
				
				eststo: reg `x' `indep_var3' , r 

				
				eststo: reg `x' `indep_var4' , r 

				
				eststo: reg `x' `indep_var5' , r 
				
				eststo: reg `x' `indep_var6' , r 


				esttab using "${path_export1}/latex_`name'.tex", replace  ///
				b(3) se(3) ///
				 keep( politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old )  coeflabel( ) ///
				order (politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old ) ///
				 star(* 0.10 ** 0.05 *** 0.01) ///
				 label ar2 booktabs nomtitle collabels(none) compress ///
				 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
				postfoot("\end{tabular}") ///
				  sfmt(0) ///
				mgroups("Ageism Index" "Ageism IAT Score" , pattern(1 0 0 0 0 0 1 0 0 0 0 0) ///
		 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
				
				}	
			
			*** 9.2.2.2 Specific Countries
			
			foreach y in Italy Korea USA {
			
			est clear
			
				foreach x in `outcomes' {		

				eststo: reg `x' `indep_var1' if country=="`y'", r 
				
				eststo: reg `x' `indep_var2' if country=="`y'", r 
				
				eststo: reg `x' `indep_var3' if country=="`y'", r 
				
				eststo: reg `x' `indep_var4' if country=="`y'", r 
				
				eststo: reg `x' `indep_var5' if country=="`y'", r 
				
				eststo: reg `x' `indep_var6' if country=="`y'", r 

				esttab using "${path_export1}/latex_`name'_`y'.tex", replace  ///
				b(3) se(3) ///
				 keep( politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old )  coeflabel( ) ///
				order (politician_too_old dummy_old_not_care dummy_age_gap_problem dummy_opinion_discr_age pol_disagreement_old ) ///
				 star(* 0.10 ** 0.05 *** 0.01) ///
				 label ar2 booktabs nomtitle collabels(none) compress ///
				 prehead("\begin{tabular}{l*{12}{D{.}{.}{-1}}}") ///
				postfoot("\end{tabular}") ///
				 sfmt(0) ///
				mgroups("Ageism Index" "Ageism IAT Score" , pattern(1 0 0 0 0 0 1 0 0 0 0 0) ///
		 prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1})
				
				}	
			}	
			
	restore
			
			
			
			
			
			
			
	